home *** CD-ROM | disk | FTP | other *** search
/ CD Fun House 1 / CD Fun House (Wayzata Technology).iso / •Interesting Stuff• / The Magic Square ••• / card_2946.txt < prev    next >
Text File  |  1990-10-06  |  10KB  |  467 lines

  1. -- card: 2946 from stack: in
  2. -- bmap block id: 3636
  3. -- flags: 0000
  4. -- background id: 2715
  5. -- name: Magic Square
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global fNo,mH,oC
  9.   if oC is "" then
  10.     set cursor to watch
  11.     lock screen
  12.     put 0 into fNo
  13.     hide card field "SW Info"
  14.     hide card field "Instructions"
  15.     hide card field "Nope"
  16.     show field a
  17.     show field b
  18.     show field c
  19.     show field d
  20.     show field e
  21.     show field f
  22.     show field g
  23.     show field h
  24.     show field i
  25.     show field j
  26.     show field k
  27.     show field l
  28.     show field m
  29.     show field n
  30.     show field o
  31.     show field p
  32.     show field q
  33.     show field r
  34.     show field s
  35.     show field t
  36.     show field u
  37.     show field v
  38.     show field w
  39.     show field x
  40.     show field y
  41.     put "" into field no1
  42.     put "" into field no2
  43.     put "" into field no3
  44.     put "" into field no4
  45.     put "" into field no5
  46.     put "" into field total
  47.     get random of 6
  48.     put it + 3 into mT
  49.     get random of 9
  50.     put it into mU
  51.     put mT & mU into mN
  52.     put "I predict that the total will be..." && mN & "." into field "Prediction"
  53.     put mT into field a
  54.     put mU into field y
  55.     get mT+mU
  56.     put mN-it into toGo
  57.     put random of 10 into z1
  58.     put random of 10 into z2
  59.     put random of 10 into z3
  60.     put random of 10 into z4
  61.     put random of 10 into z5
  62.     get z1+z2+z3+z4+z5
  63.     if it > toGo then
  64.       get it-toGo
  65.       put z5-it into z5
  66.     end if
  67.     get z1+z2+z3+z4+z5
  68.     put toGo-it into z6
  69.     get random of mT
  70.     put it into y1
  71.     put mT-y1 into y2
  72.     get random of mU
  73.     put it into y3
  74.     put mU-y3 into y4
  75.     put "xmh5639th7" into mH
  76.     put y1 + z1 into field b
  77.     put y1+z2 into field c
  78.     put y1+z3 into field d
  79.     put y1+y3 into field e
  80.     put z4+y2 into field f
  81.     put z4+z1 into field g
  82.     put z4+z2 into field h
  83.     put z4+z3 into field i
  84.     put z4+y3 into field j
  85.     put z5+y2 into field k
  86.     put z5+z1 into field l
  87.     put z5+z2 into field m
  88.     put z5+z3 into field n
  89.     put z5+y3 into field o
  90.     put z6+y2 into field p
  91.     put z6+z1 into field q
  92.     put z6+z2 into field r
  93.     put z6+z3 into field s
  94.     put z6+y3 into field t
  95.     put y4+y2 into field u
  96.     put y4+z1 into field v
  97.     put y4+z2 into field w
  98.     put y4+z3 into field x
  99.     put y4+y3 into field y
  100.     unlock screen with visual effect dissolve
  101.     set cursor to hand
  102.   else wait 0
  103. end openCard
  104.  
  105. on closeCard
  106.   lock Screen
  107.   hide card field "Instructions"
  108.   hide card field "SW Info"
  109.   put "" into field "prediction"
  110.   put "" into field a
  111.   put "" into field b
  112.   put "" into field c
  113.   put "" into field d
  114.   put "" into field e
  115.   put "" into field f
  116.   put "" into field g
  117.   put "" into field h
  118.   put "" into field i
  119.   put "" into field j
  120.   put "" into field k
  121.   put "" into field l
  122.   put "" into field m
  123.   put "" into field n
  124.   put "" into field o
  125.   put "" into field p
  126.   put "" into field q
  127.   put "" into field r
  128.   put "" into field s
  129.   put "" into field t
  130.   put "" into field u
  131.   put "" into field v
  132.   put "" into field w
  133.   put "" into field x
  134.   put "" into field y
  135.   unlock Screen
  136. end closeCard
  137.  
  138.  
  139.  
  140. -- part 30 (button)
  141. -- low flags: 00
  142. -- high flags: A003
  143. -- rect: left=287 top=260 right=282 bottom=373
  144. -- title width / last selected line: 0
  145. -- icon id / first selected line: 0 / 0
  146. -- text alignment: 1
  147. -- font id: 0
  148. -- text size: 12
  149. -- style flags: 0
  150. -- line height: 16
  151. -- part name: New Square
  152. ----- HyperTalk script -----
  153. on mouseUp
  154.   openCard
  155. end mouseUp
  156.  
  157.  
  158.  
  159. -- part 32 (button)
  160. -- low flags: 00
  161. -- high flags: 0000
  162. -- rect: left=417 top=256 right=286 bottom=454
  163. -- title width / last selected line: 0
  164. -- icon id / first selected line: 1011 / 1011
  165. -- text alignment: 1
  166. -- font id: 0
  167. -- text size: 12
  168. -- style flags: 0
  169. -- line height: 16
  170. -- part name: Go Home
  171. ----- HyperTalk script -----
  172. on mouseUp
  173.   lock screen
  174.   go home
  175.   unlock screen with visual effect dissolve
  176. end mouseUp
  177.  
  178.  
  179.  
  180. -- part 73 (button)
  181. -- low flags: 00
  182. -- high flags: 8003
  183. -- rect: left=374 top=162 right=210 bottom=453
  184. -- title width / last selected line: 0
  185. -- icon id / first selected line: 20965 / 20965
  186. -- text alignment: 1
  187. -- font id: 0
  188. -- text size: 12
  189. -- style flags: 0
  190. -- line height: 16
  191. -- part name: Shareware Info
  192. ----- HyperTalk script -----
  193. on mouseUp
  194.   lock screen
  195.   show card field "SW Info"
  196.   unlock screen with visual dissolve
  197. end mouseUp
  198.  
  199.  
  200.  
  201. -- part 75 (button)
  202. -- low flags: 00
  203. -- high flags: 0000
  204. -- rect: left=378 top=256 right=288 bottom=414
  205. -- title width / last selected line: 0
  206. -- icon id / first selected line: 21060 / 21060
  207. -- text alignment: 1
  208. -- font id: 0
  209. -- text size: 12
  210. -- style flags: 0
  211. -- line height: 16
  212. -- part name: Help
  213. ----- HyperTalk script -----
  214. on mouseUp
  215.   lock screen
  216.   show card field "Instructions"
  217.   unlock screen with visual iris open slow
  218. end mouseUp
  219.  
  220.  
  221.  
  222. -- part 76 (field)
  223. -- low flags: 81
  224. -- high flags: 0007
  225. -- rect: left=124 top=74 right=284 bottom=392
  226. -- title width / last selected line: 0
  227. -- icon id / first selected line: 0 / 0
  228. -- text alignment: 1
  229. -- font id: 3
  230. -- text size: 12
  231. -- style flags: 0
  232. -- line height: 16
  233. -- part name: Instructions
  234. ----- HyperTalk script -----
  235. on mouseUp
  236.   lock screen
  237.   hide me
  238.   unlock screen with visual iris close slow
  239. end mouseUp
  240.  
  241.  
  242. -- part 74 (field)
  243. -- low flags: 81
  244. -- high flags: 0004
  245. -- rect: left=129 top=144 right=213 bottom=388
  246. -- title width / last selected line: 0
  247. -- icon id / first selected line: 0 / 0
  248. -- text alignment: 1
  249. -- font id: 3
  250. -- text size: 12
  251. -- style flags: 0
  252. -- line height: 16
  253. -- part name: SW Info
  254. ----- HyperTalk script -----
  255. on mouseUp
  256.   lock screen
  257.   hide me
  258.   unlock screen with visual barn door close slow
  259. end mouseUp
  260.  
  261.  
  262. -- part 77 (field)
  263. -- low flags: 01
  264. -- high flags: 0000
  265. -- rect: left=24 top=132 right=144 bottom=36
  266. -- title width / last selected line: 0
  267. -- icon id / first selected line: 0 / 0
  268. -- text alignment: 0
  269. -- font id: 3
  270. -- text size: 12
  271. -- style flags: 0
  272. -- line height: 16
  273. -- part name: 
  274. ----- HyperTalk script -----
  275. on mouseUp
  276.   global mH,se,oC
  277.   put 1 into oC
  278.   visual dissolve very fast to inverse
  279.   visual dissolve very fast
  280.   go this card
  281.   put "" into oC
  282.   ask "To go on, you must know the password:"
  283.   if it is mH then
  284.     put "OK" into se
  285.     go to card 2
  286.   else
  287.     if it is "" then wait 0
  288.     else
  289.       show card field "Nope"
  290.     end if
  291.   end if
  292. end mouseUp
  293.  
  294.  
  295.  
  296. -- part 78 (field)
  297. -- low flags: 81
  298. -- high flags: 0004
  299. -- rect: left=148 top=100 right=201 bottom=374
  300. -- title width / last selected line: 0
  301. -- icon id / first selected line: 0 / 0
  302. -- text alignment: 1
  303. -- font id: 0
  304. -- text size: 12
  305. -- style flags: 0
  306. -- line height: 16
  307. -- part name: Nope
  308. ----- HyperTalk script -----
  309. on mouseUp
  310.   lock screen
  311.   hide me
  312.   unlock screen with visual dissolve
  313. end mouseUp
  314.  
  315.  
  316. -- part contents for card part 28
  317. ----- text -----
  318. 24
  319.  
  320. -- part contents for card part 34
  321. ----- text -----
  322. 24
  323.  
  324. -- part contents for card part 35
  325. ----- text -----
  326. a
  327.  
  328. -- part contents for card part 36
  329. ----- text -----
  330. b
  331.  
  332. -- part contents for card part 37
  333. ----- text -----
  334. c
  335.  
  336. -- part contents for card part 38
  337. ----- text -----
  338. d
  339.  
  340. -- part contents for card part 39
  341. ----- text -----
  342. e
  343.  
  344. -- part contents for card part 50
  345. ----- text -----
  346. f
  347.  
  348. -- part contents for card part 51
  349. ----- text -----
  350. g
  351.  
  352. -- part contents for card part 52
  353. ----- text -----
  354. h
  355.  
  356. -- part contents for card part 53
  357. ----- text -----
  358. i
  359.  
  360. -- part contents for card part 40
  361. ----- text -----
  362. j
  363.  
  364. -- part contents for card part 49
  365. ----- text -----
  366. k
  367.  
  368. -- part contents for card part 58
  369. ----- text -----
  370. l
  371.  
  372. -- part contents for card part 59
  373. ----- text -----
  374. m
  375.  
  376. -- part contents for card part 54
  377. ----- text -----
  378. n
  379.  
  380. -- part contents for card part 41
  381. ----- text -----
  382. o
  383.  
  384. -- part contents for card part 48
  385. ----- text -----
  386. p
  387.  
  388. -- part contents for card part 57
  389. ----- text -----
  390. q
  391.  
  392. -- part contents for card part 56
  393. ----- text -----
  394. r
  395.  
  396. -- part contents for card part 55
  397. ----- text -----
  398. s
  399.  
  400. -- part contents for card part 42
  401. ----- text -----
  402. t
  403.  
  404. -- part contents for card part 47
  405. ----- text -----
  406. u
  407.  
  408. -- part contents for card part 46
  409. ----- text -----
  410. v
  411.  
  412. -- part contents for card part 45
  413. ----- text -----
  414. w
  415.  
  416. -- part contents for card part 44
  417. ----- text -----
  418. x
  419.  
  420. -- part contents for card part 43
  421. ----- text -----
  422. y
  423.  
  424. -- part contents for card part 31
  425. ----- text -----
  426. I predict that the total will be... 67.
  427.  
  428. -- part contents for card part 65
  429. ----- text -----
  430. 56
  431.  
  432. -- part contents for card part 66
  433. ----- text -----
  434. 78
  435.  
  436. -- part contents for card part 67
  437. ----- text -----
  438. 90
  439.  
  440. -- part contents for card part 74
  441. ----- text -----
  442. If you like this stack, please send $5 to:
  443. Dan Wineman
  444. 608 Crum Creek Road
  445. Wallingford, PA 19086
  446.  
  447.  
  448. -- part contents for card part 76
  449. ----- text -----
  450. The Magic Square
  451. by Dan Wineman
  452. Ver. 1.0
  453.  
  454. Instructions
  455. (Click anywhere in this box to close)
  456. The Magic Square is a magic trick which works as follows:
  457. A 5 by 5 grid of squares appears; a number is in each square.  The computer makes its prediction, as to what the total of the numbers you choose will be, in a box to the right.
  458. When you click a number, it and all of the numbers in its row and column disappear.  The number you click goes into one of five boxes to the right of the grid, and the total thus far appears in the ‚ÄúTotal:‚Äù box.  You proceed, choosing four more numbers, each of which goes in a box, and the total increases each time.  When you finish, you look at the total, and... well, I‚Äôll let you find that part out for yourself.
  459. After you have finished checking the computer‚Äôs arithmetic, you may try another grid by clicking ‚ÄúNew Square.‚Äù
  460.  
  461. (Oh‚Äîand, incidentally, if you feel you must know how this is done, there is a secret spot somewhere on the picture frame, which, when clicked, will give you a surprise.)
  462.  
  463.  
  464. -- part contents for card part 78
  465. ----- text -----
  466. Sorry, wrong password.
  467. Send in the shareware fee (if you haven't already) plus an extra $2.50 and I‚Äôll mail you the password.  With it, you‚Äôll learn the secret to the Magic Square.